package com.starmark.sys.org.oauth.mapper;

import com.starmark.core.framework.base.SuperMapper;
import com.starmark.sys.org.oauth.entity.SysOrgOauth;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author starmark
 * @since 2019-07-27
 */
@Mapper
public interface SysOrgOauthMapper extends SuperMapper<SysOrgOauth> {

    /**
     * @param openId     第三方登陆ID
     * @param sourceType 数据来源
     * @return 返回用户ID
     */
    @Select("select user_id from sys_org_oauth where open_id=#{openId} and source_type=#{sourceType}")
    String getUserId(@Param("openId") String openId, @Param("sourceType") String sourceType);

}